/**
 * Created by Administrator on 2015/12/20 0020.
 */
class Interserct
{
    public static LinInterserct(pt1:egret.Point,pt2:egret.Point,pt3:egret.Point,pt4:egret.Point):boolean
    {
        if(pt1.x!=pt2.x) {
            var k1 = (pt1.y - pt2.y) / (pt1.x - pt2.x);
            var b1 = (pt1.x * pt2.y - pt2.x * pt1.y) / (pt1.x - pt2.x);
        }
        if(pt3.x!=pt4.x)
        {
         var k2=(pt3.y-pt4.y)/(pt3.x-pt4.x);
         var b2=(pt3.x*pt4.y - pt4.x*pt3.y)/(pt3.x-pt4.x);
        }
        if(k1==k2)
        {
            console.log('k1==k2:',pt1.y,pt3.y);
            if(pt1.y>pt3.y-11&&pt1.y<pt3.y+11)
            {
                console.log('true');
                return true;
            }
            else
            {
                return false
            }


        }
        else
        {
            var x = (b2-b1) / (k1-k2);
            console.log('k1!=k2:',x);
            if(x>pt1.x&&x<pt2.x&&x>pt3.x&&x<pt4.y)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
    }
}
